class PropertyPatternProperty < ActiveRecord::Base
  acts_as_list :scope => :property_pattern_id

  belongs_to :property_pattern, :touch => true
  
  has_many :property_attributes, :order => :lft, :dependent => :destroy, :class_name => "PropertyPatternPropertyAttribute"

  validates :presentation, :presence => true, :length => {:maximum => 35}
  validates :property_pattern_id, :presence => true

  accepts_nested_attributes_for :property_attributes, :allow_destroy => true
end